
from ext import db

print(db, ' <- db ')

class MachineModel(db.Model):
    __tablename__ = 't_project_machine'
    id = db.Column(db.Integer, primary_key=True)
    ip = db.Column(db.String(20), unique=True)
    port = db.Column(db.Integer)

    def __repr__(self):
        return f'MachineModel:  id: {self.id} , ip: {self.ip}, port: {self.port} '

    def to_json(self):
        return {
            'id': self.id,
            'ip': self.ip,
            'port': self.port
        }

